/*-------------------------------------
		sPlugin
	    By Scooby, 2010
-------------------------------------*/

local PLUGIN = {}

PLUGIN.Name = "Kick"
PLUGIN.Author = "Scooby"
PLUGIN.Command = "kick"
PLUGIN.Group = 2
PLUGIN.Category = "Punishment"
PLUGIN.Use = "<Player> <Reason>"
PLUGIN.Format = "string string"
PLUGIN.Menu = { 
	{ 
		title = "Select Player", 
		cont = "#players", 
		apos = 1 
	}, 
	{ 
		title = "Select Reason", 
		cont = { "Spammer", "Annoying", "Hacker", "Retard", "Asshole" }, 
		apos = 2 
	} 
}

function PLUGIN:Main( pl, args )
	
	print( "Function Called" )
	PrintTable( args )
	local ply = spl:FindPly( args[1] )
	if( #ply == 0 ) then
		spl:PrintC( pl, spl.red, spl.fnp )
		return false
	elseif( #ply > 1 ) then
			spl:PrintC( pl, spl.red, spl.fmp )
		return false
	end
		
	local res = {}
		if( #args == 1 ) then
			res = { "No Reason Specified" }
	else
		table.remove( args, 1 )
		res = args
	end
	local reason = table.concat( res, " " )
	print( reason )
	if( gatekeeper ) then
		gatekeeper.Drop( ply[1]:UserID(), "Kicked For "..reason )
	else
		ply[1]:Kick( reason )
	end
	spl:PrintC( spl.red, ply[1]:Nick(), spl.white, " Was Kicked By ", spl.blue, pl:Nick(), spl.white, " ( "..reason.." ) " )
end


spl:AddPlugin( PLUGIN )